const fields = [
  {
    dataIndex: 'index',
    key: 'index',
    title: '序号',
    width: 80,
    scopedSlots: {
      customRender: 'subscript'
    }
  },
  {
    dataIndex: 'title',
    key: 'title',
    title: '文章标题',
    scopedSlots: {
      customRender: 'TextAction'
    },
    width:200
  },
  {
    dataIndex: 'pulishDate',
    key: 'pulishDate',
    width: 100,
    title: '发布日期'
  },
  {
    dataIndex: 'statusStr',
    key: 'statusStr',
    title: '状态',
    width: 100,
    scopedSlots: {
      customRender: 'color'
    }
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    scopedSlots: {
      customRender: 'action'
    },
    width:200
  }
]

const formRow = [
  {
    span: 10,
    label: '文章标题',
    component: 'AInput',
    placeholder: '请输入文章标题',
    prop: 'title',
    allowClear: true
  },
]

const slotOpt = [
  {
    slot: 'TextAction',
    component: 'TextAction',
    cb: 'toDetail'
  },
  {
    slot: 'action',
    component: 'Action',
    list: [
      { name: '编辑', cb: 'edit' },
      { name: '删除', cb: 'singleDelete', divider: true },
      { name: '下架', cb: 'singleDrop', divider: true },
    ]
  }
]

module.exports = {
  fields,
  formRow,
  slotOpt
}
